home *** CD-ROM | disk | FTP | other *** search
/ Art Fundamentals - Core Concepts in Art / Art Fundamentals: Core Concepts in Art.iso / pc / color.dxr / 00179.ls < prev    next >
Encoding:
Text File  |  2001-07-16  |  1.4 KB  |  55 lines

  1. on mouseDown me
  2.   global r1, g1, b1, X, Y, squarecolor
  3.   repeat while the mouseDown
  4.     if Y < 17 then
  5.       Y = Y + 1
  6.       set the locV of sprite 32 to the locV of sprite 32 - 15
  7.       set the locV of sprite 31 to the locV of sprite 32 + 10
  8.       set the locH of sprite 31 to the locH of sprite 32 + 10
  9.       if squarecolor = "red" then
  10.         r1 = 15 * Y
  11.         g1 = X * 15 / 17 * Y
  12.         b1 = g1
  13.       else
  14.         if squarecolor = "yellow" then
  15.           r1 = 15 * Y
  16.           g1 = r1
  17.           b1 = X * 15 / 17 * Y
  18.         else
  19.           if squarecolor = "green" then
  20.             r1 = X * 15 / 17 * Y
  21.             g1 = 15 * Y
  22.             b1 = r1
  23.           else
  24.             if squarecolor = "cyan" then
  25.               r1 = X * 15 / 17 * Y
  26.               g1 = 15 * Y
  27.               b1 = g1
  28.             else
  29.               if squarecolor = "blue" then
  30.                 r1 = X * 15 / 17 * Y
  31.                 g1 = r1
  32.                 b1 = 15 * Y
  33.               else
  34.                 if squarecolor = "purple" then
  35.                   r1 = 15 * Y
  36.                   g1 = X * 15 / 17 * Y
  37.                   b1 = r1
  38.                 end if
  39.               end if
  40.             end if
  41.           end if
  42.         end if
  43.       end if
  44.       put sprite(32).color
  45.       sprite(32).color = rgb(r1, g1, b1)
  46.     end if
  47.     put Y * 15 / 2.54999999999999982 into field "b field"
  48.     startTimer()
  49.     repeat while the timer < 10
  50.       nothing()
  51.     end repeat
  52.     updateStage()
  53.   end repeat
  54. end
  55.